fileType="sent";
var mygrid;
	$(function() {
		mygrid = $("#list").jqGrid({
			url : "fileserver/file/file-data!typedfile",
			postData : {"folder.type" : "sent"},
			datatype : "json",
			mtype : 'GET',
			colNames : [ '选择', '文件名', '类型', '接受者', '发送日期', '管理' ],
			colModel : [ {
				name : 'id',
				index : 'id',
				width : 30,
				formatter : selectFormatter
			}, {
				name : 'title',
				index : 'title',
				width : 200,
				formatter : nameFormatter

			}, {
				name : 'imgpath',
				index : 'imgpath',
				width : 50,
				formatter : function(v, opt, row) {
					return "<img src='"+sbase+v+"' width='16' height='16' />";
				}
			}, {
				name : 'owner',
				index : 'owner',
				width : 100,
				formatter : function(v, opt, row) {
					return v.localName;
				}
			}, {
				name : 'createTime',
				index : 'createTime',
				width : 100
			// formatter:date
			}, {
				name : 'did',
				index : 'id',
				width : 50,
				formatter : deleteFormater
			} ],
			pager : '#pager',
			rowNum : 10,
			rowList : [ 10, 20, 30 ],
			sortname : 'createTime',
			sortorder : 'desc',
			viewrecords : true,
			caption : '我的已发文件',
			width : '750',
			height : '300',
			jsonReader : {
				repeatitems : false,
				id : "0"
			}
		});

		function selectFormatter(cv, opt, row) {
			var fid = row['id'];
			var title = row['title'];
			var link = $("<input type=\"checkbox\" onclick=\"checkFile('" + fid
					+ "','" + title + "',this.checked);\"></input>");
			return $("<span></span>").append(link).html();

		}
		function nameFormatter(cv, opts, row) {
			var eid = row['id'];
			var link = $("<a></a>");
			link.attr("href","fileserver/file/download!download?bean.id="+eid);
		    link.attr("target","_self");
			link.html("<strong>"+cv+"</strong>");
			return $("<span></span>").append(link).html();
		}

		function deleteFormater(cv, opt, row) {
			var eid = row['id'];
			var link = $("<a></a>");
			link.attr("href", "javascript:removeMe('" + eid + "');");
			link.html("<img src='"+sbase+"images/removeme.gif' style='border:none'/>");
			return $("<span></span>").append(link).html();
		}

	});